<template>
  <div class="goods-sale" style="margin-top: 14px;">
    <goods-box :goodsItems="goodsItems" ></goods-box>
  </div>
</template>

<script>
import GoodsBox from './GoodsBox' 
import {getHome} from './../../service/home'

export default {
  data () {
    return {
      goodsItems:[]
    }
  },

   // 生命周期钩子函数
  mounted() {
    this.init();
  },
  methods:{
  async init(){
      const {data}=await getHome();
      this.goodsItems=data.recommendGoodses
    }
  },
  components: {
    'GoodsBox': GoodsBox
  }
}
</script>

<style lang="less">
  .goods-sale {
      position: relative;
      
    text-align: center;
      width: 1226px;
      height: auto;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
  }
  .goods-sale * {
    box-sizing: border-box;
  }
</style>